//
//  mapping.cpp
//  Steady (Revised Version)
//
//  Created by Duong Ngo on 8/13/16.
//  Copyright © 2016 Duong Ngo. All rights reserved.
//

#include "mapping.hpp"

//-----------------------------------------------------------------------------
// Find the map f: name of variables --> its position
//-----------------------------------------------------------------------------
void find_variable_s (const Number* x, variables& s)
{
    // Current Variables
    int px= 0;
    
    s.gamma= x[px+0]; s.cb= x[px+1]; s.Rf= x[px+2]; s.Rm= x[px+3]; s.ql= x[px+4];
    s.mur= x[px+5]; s.muc= x[px+6];  s.ip= x[px+7]; s.pie= x[px+8]; s.n= x[px+9];
    s.m=x[px+10]; s.bh= x[px+11]; s.k= x[px+12]; s.tau= x[px+13];  s.s=x[px+14];
    s.ch= x[px+15]; s.etaz=x[px+16]; s.lama= x[px+17]; s.lamb=x[px+18]; s.etab= x[px+19];
    s.i=x[px+20]; s.pm=x[px+21]; s.y=x[px+22]; s.l= x[px+23]; s.u=x[px+24];
    
 
}

//-----------------------------------------------------------------------------
// Find the map f: name of variables --> its position
//-----------------------------------------------------------------------------
void find_map (std::map<std::string,int>& f)
{
    //Current Variables
    int px= 0;
    
    //Bankers
    f["s.gamma"]= px+0; f["s.cb"]=px+1; f["s.Rf"]=px+2; f["s.Rm"]=px+3; f["s.ql"]=px+4;
    f["s.mur"]=px+5; f["s.muc"]=px+6; f["s.ip"]=px+7; f["s.pie"]=px+8;  f["s.n"]=px+9;
    f["s.m"]=px+10; f["s.bh"]=px+11; f["s.k"]=px+12; f["s.tau"]=px+13; f["s.s"]=px+14;
    f["s.ch"]=px+15; f["s.etaz"]=px+16; f["s.lama"]=px+17; f["s.lamb"]=px+18; f["s.etab"]=px+19;
    f["s.i"]=px+20; f["s.pm"]=px+21; f["s.y"]=px+22; f["s.l"]=px+23; f["s.u"]=px+24;
    
}